/**
 * Hackystat Version 8 Framework
 * Sensor Data Viewer Widget
 */
package org.hackystat.ui.sensordataviewer.client.common;

import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;

/**
 * Remote procedure call interface for getting sensor data from a Hackystat 8 SensorBase server. 
 * Returns a formatted description of the sensor data over the requested interval.
 * 
 * @author David J. Nickles
 */
public interface RPCRemoteService extends RemoteService {
  
  /**
   * Return a formatted description of the requested sensor data on the specified interval.
   * @param host the URI for the SensorBase
   * @param project the project of interest
   * @param user user to authentication
   * @param password user password for authentication
   * @param startXmlTime of interval
   * @param endXmlTime of interval
   * @return Boolean array of days with data
   * @throws RPCException if problems occur during the Sensorbase procedure call
   * 
   * @gwt.typeArgs <java.util.ArrayList<java.lang.String>>
   */
  public ArrayList getMod(String host, String project, String user, String password, 
    String startXmlTime, String endXmlTime) throws RPCException;
  
  /**
   * Return a formatted description of the requested sensor data on the specified interval.
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @param password user password for authentication
   * @param hrefList the list of hrefs for the sensor data items
   * @return String Description of the requested sensor data
   * 
   * @gwt.typeArgs hrefList <java.lang.String>
   * @gwt.typeArgs <java.util.ArrayList<java.lang.String>>
   */
  public ArrayList getHrefs(String host, String user, String password, List hrefList);

  /**
   * Returns true if the passed host is a SensorBase host.
   * 
   * @param host the URI for the SensorBase
   * @return Boolean indicating if the host is a valid sensorbase
   */
  public Boolean isHost(String host);

  /**
   * Returns true if the user and password is registered as a user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @param password key for authentication
   * @return Boolean indicating if the user and password are valid in the sensorbase
   */
  public Boolean isRegistered(String host, String user, String password);

  /**
   * Registers the user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @return Boolean indicating if the user and password are valid in the sensorbase
   */
  public Boolean registerUser(String host, String user);
  
  /**
   * Returns the version number from the Manifest file.
   * 
   * @return String the version number from the Manifest file.
   */
  public String version(); 
  
  /**
   * Returns the host uri from the properties file.
   * 
   * @return String the host uri.
   */
  public String getHost(); 
}
